﻿<iStudio:ModuleWindow x:Class="iStudio.Module.Effect.EffectWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:iStudio="http://schemas.arvystate.net/2012/presentation/iStudio"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Title="Effects"
             FloatingWindowSize="450, 250"
             d:DesignHeight="550" d:DesignWidth="250">
    <iStudio:ModuleWindow.Resources>
        <iStudio:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
    </iStudio:ModuleWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        
        <!-- Apply Convolution -->
        <Grid Margin="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBlock Foreground="White" Text="Ambient Effect" FontWeight="SemiBold" HorizontalAlignment="Center" Margin="75,10" Grid.ColumnSpan="2" />

            <ComboBox Grid.Row="1" Name="convolution_track1" Margin="0,0,0,10" Height="23" ItemsSource="{Binding}" />
            <TextBlock Grid.Row="1" Margin="10,0,0,10" Foreground="#FF989898" Text="Select Audio Track" Visibility="{Binding SelectedItem, ElementName=convolution_track1, Converter={StaticResource NullToVisibilityConverter}}" IsHitTestVisible="False" VerticalAlignment="Center" />


            <ComboBox Grid.Row="2" Name="convolution_track2" Margin="0,0,0,10" Height="23" ItemsSource="{Binding}" />
            <TextBlock Grid.Row="2" Margin="10,0,0,10" Foreground="#FF989898" Text="Select Impulse Response" Visibility="{Binding SelectedItem, ElementName=convolution_track2, Converter={StaticResource NullToVisibilityConverter}}" IsHitTestVisible="False" VerticalAlignment="Center" />
  

            <Button Grid.Row="3" Content="Convolve" Height="23" HorizontalAlignment="Right" Name="button_convolve" VerticalAlignment="Center" Width="75" Grid.Column="1" Click="ButtonConvolveClick" />

        </Grid>
        
        <!-- Fade Effect -->
        <Grid Grid.Row="1" Margin="10,0,10,10">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <TextBlock Foreground="White" Grid.ColumnSpan="2" Text="Fade Effect" FontWeight="SemiBold" HorizontalAlignment="Center" Margin="10" />

            <CheckBox Grid.Row="1" Name="check_fadein" Content="Fade in" VerticalAlignment="Center" />
            <CheckBox Grid.Row="2" Name="check_fadeout" Content="Fade out" VerticalAlignment="Center" />

            <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Margin="0,0,0,10">
                <TextBox Name="fade_length" Height="23" Width="40" />
                <TextBlock Foreground="White" Text="ms (duration)" Margin="5,0,0,0" Grid.Row="1" VerticalAlignment="Center" />
            </StackPanel>

            <Button Grid.Row="2" Grid.Column="1" Content="Apply" Height="23" HorizontalAlignment="Center" Name="button_fadeeffect" VerticalAlignment="Center" Width="75" Click="ButtonFadeeffectClick" />
        </Grid>
        
        <!-- Chorus Effect -->
        <Grid Grid.Row="2" Margin="10,0,10,10">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <TextBlock Foreground="White" Grid.ColumnSpan="2" Text="Chorus Effect" FontWeight="SemiBold" HorizontalAlignment="Center" Margin="10" />

            <TextBlock Foreground="White" Text="Delays" Grid.Row="1" VerticalAlignment="Center" />
            <TextBox Name="chorus_delays" Grid.Row="1" Grid.Column="1" Margin="5,5,10,5" Height="23" Text="150 300" />

            <TextBlock Foreground="White" Text="Strength" Grid.Row="2" VerticalAlignment="Center" />
            <TextBox Name="chorus_strength" Grid.Row="2" Grid.Column="1" Margin="5,5,10,5" Height="23" Text="0.5 0.3" />

            <Button Grid.Row="3" Grid.Column="1" Content="Apply" Margin="10" Height="23" HorizontalAlignment="Right" Name="button_choruseffect" VerticalAlignment="Center" Width="75" Click="ButtonChoruseffectClick" />
        </Grid>

        <!-- Flanger Effect -->
        <Grid Grid.Row="3" Margin="10,0,10,10">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <TextBlock Foreground="White" Grid.ColumnSpan="2" Text="Flanger Effect" FontWeight="SemiBold" HorizontalAlignment="Center" Margin="10" />

            <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="0,0,0,10">
                <TextBox Name="flanger_delay" Height="23" Width="40" Text="10" />
                <TextBlock Foreground="White" Text="Delay in ms" Margin="5,0,0,0" />
            </StackPanel>


            <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Margin="0,0,0,10">
                <TextBox Name="flanger_freq" Height="23" Width="50" Text="2" />
                <TextBlock Foreground="White" Text="Hz" Margin="5,0,0,0" />
            </StackPanel>

            <Button Grid.Row="2" Grid.Column="1" Content="Apply" Height="23" HorizontalAlignment="Right" Name="button_flangereffect" VerticalAlignment="Center" Width="75" Click="ButtonFlangereffectClick" />
        </Grid>
    </Grid>
</iStudio:ModuleWindow>
